<script type="text/javascript" src="{{asset('statics/js/infinite.js')}}"></script>
<script type="text/javascript" src="{{asset('game/js/jquery.min.js')}}"></script>
<script>
    $.ajaxSetup({
        headers: {
            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
        }
    });
    var app = new Vue({
        el: '#app',
        data: {
            list: [],
            page:1,
            loading:false,
            stopLoading:false,
        },

        methods: {
            loadMore:function(){
                if(this.stopLoading==true){
                    return this.loading= false
                }
                this.loading=true;
                $.post('{{$url}}',{page:this.page},function(data){
                    app.page++;

                    for(var i=0;i<data.data.length;i++){
                        app.list.push(data.data[i]);
                    }
                    if(data.next_page_url==null){
                        app.stopLoading=true;
                        app.loading=false;
                        return ;
                    }
                    app.loading=false;
                })
            },

        }


    });

</script>